home *** CD-ROM | disk | FTP | other *** search
/ kermit.columbia.edu / kermit.columbia.edu.tar / kermit.columbia.edu / newsgroups / misc.19970929-19971216 / 000117_news@newsmaster….columbia.edu _Thu Oct 16 10:27:31 1997.msg < prev    next >
Internet Message Format  |  1997-12-15  |  2KB

  1. Return-Path: <news@newsmaster.cc.columbia.edu>
  2. Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.35.30])
  3.     by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id KAA02336
  4.     for <kermit.misc@watsun.cc.columbia.edu>; Thu, 16 Oct 1997 10:27:30 -0400 (EDT)
  5. Received: (from news@localhost)
  6.     by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id KAA17288
  7.     for kermit.misc@watsun; Thu, 16 Oct 1997 10:27:29 -0400 (EDT)
  8. Path: news.columbia.edu!watsun.cc.columbia.edu!fdc
  9. From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
  10. Newsgroups: comp.protocols.kermit.misc
  11. Subject: Re: Take Script parameter's??
  12. Date: 16 Oct 1997 14:27:28 GMT
  13. Organization: Columbia University
  14. Lines: 41
  15. Message-ID: <62588g$5i$1@apakabar.cc.columbia.edu>
  16. References: <623oj3$lrl$1@goanna.cs.rmit.edu.au>
  17. NNTP-Posting-Host: watsun.cc.columbia.edu
  18. Xref: news.columbia.edu comp.protocols.kermit.misc:7896
  19.  
  20. In article <623oj3$lrl$1@goanna.cs.rmit.edu.au>,
  21. Ross Irvine <rwi@yallara.cs.rmit.edu.au> wrote:
  22. :     I would like to be able to give me scripts command line 
  23. : arguments, but it doesn't like it. It always says that the extra 
  24. : characters (the argument) are ignored.
  25. : How can I pass command line args to scripts???
  26. : Eg
  27. : Kermit> take dothis.ksc {Some text Message}
  28. define xx take dothis.ksc
  29. xx {Some text Message}
  30.  
  31. This sets the macro parameters \%1, \%2, etc, and they will be
  32. visible to the command file (change "xx" to whatever you want
  33. to call the macro).
  34.  
  35. A more general method does not hardwire the filename, but instead
  36. takes it as the first parameter, and then shifts the others over
  37. (using syntax supported by K95, C-Kermit 6.0, and MS-DOS Kermit 3.15):
  38.  
  39. define xx {
  40.     local filename
  41.     asg filename \%1
  42.     asg \%1 \%2
  43.     asg \%2 \%3
  44.     asg \%3 \%4
  45.     asg \%4 \%5
  46.     asg \%5 \%6
  47.     asg \%6 \%7
  48.     asg \%7 \%8
  49.     asg \%8 \%9
  50.     undef \%9
  51.     tak \m(filename)
  52.     end \v(status)
  53. }
  54. xx dothis.ksc {Some text Message}
  55.  
  56. - Frank